import javax.swing.ButtonGroup;
import javax.swing.JPopupMenu;


public class RepresentationSelection extends JPopupMenu {
	public RepresentationSelection(QuiverPanel panel){
		ButtonGroup buttonGroup = new ButtonGroup();
		Representation activeRepr = panel.getActiveRepresentation();
		RepresentationItem emptyReprItem = new RepresentationItem(null);
		if (activeRepr == null){
			emptyReprItem.setSelected(true);
		}
		buttonGroup.add(emptyReprItem);
		add(emptyReprItem);
		
		for (Representation repr : panel.getRepresentations()){
			RepresentationItem reprItem = new RepresentationItem(repr);
			if (repr == activeRepr){
				reprItem.setSelected(true);
			}
			buttonGroup.add(reprItem);
			add(reprItem);
		}
	}
}
